package com.lst.tools.wx.smallroutine.vo;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;

/**
 * @author: Frank
 * @date: 2019/09/24 13:51
 * @version: V1.0
 */
@Data
@NoArgsConstructor
public class SmallRoutineEncryptedDataParam {
    /**
     * appId
     */
    @NotBlank
    private String appId;
    /**
     * secret
     */
    @NotBlank
    private String secret;
    /**
     * 用户登录凭证（有效期五分钟）。开发者需要在开发者服务器后台调用 api，使用 code 换取 openid 和 session_key 等信息
     */
    @NotBlank
    private String code;

    /**
     * 加密数据
     */
    @NotBlank
    private String encryptedData;

    /**
     * 加密算法的初始向量
     */
    @NotBlank
    private String iv;

    public SmallRoutineEncryptedDataParam putAppId(String appId) {
        this.appId = appId;
        return this;
    }

    public SmallRoutineEncryptedDataParam putSecret(String secret) {
        this.secret = secret;
        return this;
    }

    public SmallRoutineEncryptedDataParam putCode(String code) {
        this.code = code;
        return this;
    }

    public SmallRoutineEncryptedDataParam putEncryptedData(String encryptedData) {
        this.encryptedData = encryptedData;
        return this;
    }

    public SmallRoutineEncryptedDataParam putIv(String iv) {
        this.iv = iv;
        return this;
    }
}
